import { Vector3 } from "three";
import { Service, App, ResManager } from "vjmap3d";
import "vjmap3d/dist/vjmap3d.min.css";
export const createApp = (containerID: string) => {
    const env = {
        serviceUrl: "https://vjmap.com/server/api/v1", 
        accessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MiwiVXNlcm5hbWUiOiJhZG1pbjEiLCJOaWNrTmFtZSI6ImFkbWluMSIsIkF1dGhvcml0eUlkIjoiYWRtaW4iLCJCdWZmZXJUaW1lIjo4NjQwMCwiZXhwIjo0ODEzMjY3NjM3LCJpc3MiOiJ2am1hcCIsIm5iZiI6MTY1OTY2NjYzN30.cDXCH2ElTzU2sQU36SNHWoTYTAc4wEkVIXmBAIzWh6M"
    };
    let svc = new Service(env.serviceUrl, env.accessToken);
    let app = new App(svc, {
        container: containerID,
        render: {
            // @ts-ignore
            alpha: true,
            //  clearColor: "#000117",
            powerPreference: "default",
            antialias: true,
        },
        stat: {
            show: true,
            left: "0",
            top: "50px"
        },
        scene: {
            showAxesHelper: false,
            axesHelperSize: 1,
            gridHelper: {
                visible: true,
                args: [1000, 1000],
                cellSize: 10,
                sectionSize: 100
            }
        },
        camera: {
            isOrthographicCamera: false,
            fov: 45,
            near: 0.05,
            far: 1000,
            autoNearFar: false,
            viewHelper: {
                enable: false,
                position: "leftBottom"
            }
        },
        control: {
            initState: {
                cameraTarget: new Vector3(18, 0, -3),
				cameraPosition: new Vector3(18, 70, 108),
            }
        }
    });
    return app
}